#include<iostream>
using namespace std;
bool isRun(int y);
int main()
{
    int year;
    cin >> year;
    cout << isRun(year) << endl;
    return 0;
}
bool isRun(int y)
{
    if ((y % 4 == 0) && (y % 100 != 0)) return true;
    else if ((y % 100 == 0) && (y % 400 == 0)) return true;
    else return false;
}